//
//  Emoji.swift
//  1-自定义键盘搭建
//
//  Created by yellow on 15/10/23.
//  Copyright © 2015年 yellow. All rights reserved.
//

import UIKit

/// 表情图标模型
class Emoji: NSObject {
    
 /// 表情名称
    var chs:String?
 /// PNG图片名称
    var png:String?
 /// emoji的uincode的二进制str
    var code:String?{
        didSet{
            emojiUnicode = code?.emoji
        }
    }
    
    init(dict:[String:AnyObject]) {
        super.init()
        setValuesForKeysWithDictionary(dict)
    }
    
    init(isDeleteBtn:Bool) {
        super.init()
        self.isDeleteBtn = isDeleteBtn
    }
    
    init(isSpaceBtn:Bool) {
        super.init()
        self.isSpaceBtn = isSpaceBtn
    }
    
    
    /// code转化为Unicode的str
    var emojiUnicode:String?
    
    //返回该表情对应的图片path
    var imagePath:String{
        return png == nil ? "" : NSBundle.mainBundle().bundlePath + "/Emoticons.bundle/" + png!
    }
    
    /// 判断是否为删除按钮,当collectionView的数据源调用该方法时，判断到是删除按钮就cell中的btn就显示compose_emotion_delete图片
    var isDeleteBtn:Bool?
    
    //是否为空白按钮
    var isSpaceBtn:Bool?
    
    
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
    
        
    }
    
    override var description:String{
        
        let keys = ["chs","png","code"]
    
        return dictionaryWithValuesForKeys(keys).description
    }
}
